package com.example.diancai.entity;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.example.diancai.dto.Vec3DTO;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName(value = "game_user", autoResultMap = true)
public class GameUser {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 微信id
     */
    @TableField(value = "lv")
    private String lv;

    /**
     * 微信用户名称
     */
    private Integer score;


    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<List<Vec3DTO>> array;

    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<List<List<Vec3DTO>>> arrayHistory;

    private int backNum;

    private String gameType;

    private Integer wxUserId;

    /**
     * 0:未结束 1：已结束
     */
    private Integer gameOver;


    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private int maxScore;
}